s = "ilovecodingonleetcode"
# 我成功了
char_dict = {}
for i in s:
    if char_dict.get(i):
        char_dict[i] += 1
    else:
        char_dict[i] = 1

print(char_dict)